package cn.webrx.coll;/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>Project: jse2204 - cn.webrx.coll.Student
 * <p>Powered by webrx On 2022-09-19 11:22:46
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student implements Comparable<Student> {
    private int id;
    private String name;
    private int score;
    private String address;

    /**
     * 默认排序
     *
     * @param o the object to be compared.
     * @return
     */
    @Override
    public int compareTo(Student o) {
        //this a  o b  (a,b) -> a.id - b.id
        return id - o.id;
    }
}
